<?php
/**
 * CreateUser: zlh
 * CreateTime: 2022/1/21 15:28
 * Remark:
 */

namespace App\Scopes;

use App\Func\TokenFuc;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;

class ClientAuthScope implements Scope
{
    public function apply(Builder $builder, Model $model)
    {
        $companyId = TokenFuc::getCurrentStaffInfo()['company_id'];
        $builder->where('company_id',$companyId);
    }
}